# -*- encoding: utf-8 -*-
"""
@File    : air_quality.py
@Time    : 2020/10/20 17:29
@Author  : lluyao
@Email   : lluyao61@163.com
@Software: PyCharm
"""

while True:
    user_input = input('请输入空气质量指数：')
    if user_input.isdigit():
        pm = int(user_input)
        if 0 <= pm <= 50:
            print('空气质量状况：优')
        elif 51 <= pm <= 100:
            print('空气质量状况：良')
        elif 101 <= pm <= 150:
            print('空气质量状况：轻度污染')
        elif 151 <= pm <= 200:
            print('空气质量状况：中度污染')
        elif 201 <= pm <= 300:
            print('空气质量状况：重度污染')
        else:
            print('空气质量状况：严重污染')
    elif user_input == 'Q':
        break
    else:
        print('请输入合法数值')


